www.gusucode.com > 云网互动影视系统(12套模版和资源联盟) 6.2 > 云网互动影视系统(12套模版和资源联盟) 6.2.4/免费版/Admin/YWNT_TMS_Inc/JsFunction.asp

    <%function TypeJs(typeid,containSubClass,Region,Style,Volume,TdVolume,Attribute,picwidth,picheight,ShowTitle,TitleVolume,TitleStyle,ShowActor,ActorVolume,Showtype,ShowRegion,ShowClick,ShowCoin,ShowDate,ShowContent,ContentVolume,Sorting,OpenStyle,BgColor,BgPic,BorderColor)
		dim i
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select top "&Volume&" * from YWNT_TMS_Movie WHERE MovieHide=0 and MovieRecovery=0 and MovieAudit=1 AND"
 		If typeid<>"" Then 
		If containSubClass<>"" Then
		typeidW=typeid&","&ClassIDIN(typeid)
		typeidW=left(typeidW,len(typeidW)-1)
		sql=sql&" TypeID in ("&typeidW&") AND"
		Else
		sql=sql&" TypeID = "&typeid&" AND"
		End If
		End If
 		If Region<>"" Then sql=sql&" MovieRegion="&Region&" AND"
 		IF Attribute<>"" Then
 		If Attribute=1 Then sql=sql&" MovieSuggest=1 AND"
 		If Attribute=2 Then sql=sql&" MovieHot=1 AND"
 		If Attribute=3 Then sql=sql&" MovieSerialization=1 AND"
		If Attribute=4 Then sql=sql&" MovieFree=1 AND"
 		End If
 		If right(sql,5)="WHERE" then sql=left(sql,clng(len(sql))-5) '解决所有参数都为空的情况
 		If right(sql,3)="AND" then sql=left(sql,clng(len(sql))-3) '去掉参数最后的and
		Select Case Sorting
		Case 1
		sql=sql&" Order by ID desc"
		Case 2
		sql=sql&" Order by ID asc"
		Case 3
		sql=sql&" Order by MovieDate desc,id desc"
		Case 4
		sql=sql&" Order by MovieDate asc,id asc"
		Case 5
		sql=sql&" Order by MovieClick desc,id desc"
		Case 6
		sql=sql&" Order by MovieClick asc,id asc"
		end Select
		Rs.open sql,Conn,1,1
		TypeJs="<table width=""100%""  border=""0"" cellspacing=""0"" cellpadding=""0"">"
  		TypeJs=TypeJs&"<tr>" &vbcrlf
		do while not RS.eof
		if OpenStyle=1 then
		OpenS="target=""_blank"""
		end if
		Select Case GetConfig("WebHtmlMode")
		Case "asp"
		jsmovieurl=GetConfig("Weburl")&"/movie.asp?id="&RS("id")
		jsclassurl=GetConfig("Weburl")&"/class.asp?id="&RS("Typeid")
		Case else
		jsmovieurl=GetConfig("Weburl")&"/"&GetConfig("HtmlDIr")&"movie_"&RS("id")&"."&GetConfig("WebHtmlMode")
		jsclassurl=GetConfig("Weburl")&"/"&GetConfig("HtmlDIr")&ClassNameE(RS("Typeid"))&"."&GetConfig("WebHtmlMode")
		end Select
		i=i+1
		Select Case Style
		Case 1
		TypeJs=TypeJs&"<td width="""&(100/TdVolume)&"%""><table width=""100%"" border=""0"" cellspacing=""5"" cellpadding=""0"">" &vbcrlf
        TypeJs=TypeJs&"<tr>" &vbcrlf
        TypeJs=TypeJs&"<td width="""&(picwidth+20)&"""><table border=""0"" align=""center"" cellpadding=""5"" cellspacing=""0"" bgcolor="""&BgColor&""" background="""&BgPic&""" style=""border: 1px solid "&BorderColor&";"">" &vbcrlf
        TypeJs=TypeJs&"<tr>" &vbcrlf
        TypeJs=TypeJs&"<td align=""center""><a href="""&jsmovieurl&""" "&OpenS&"><img src="""&RS("MoviePic")&""" width="""&picwidth&""" height="""&picheight&""" border=""0""></a></td>" &vbcrlf
        TypeJs=TypeJs&"</tr>" &vbcrlf
       	TypeJs=TypeJs&"</table></td>" &vbcrlf
        TypeJs=TypeJs&"<td valign=""top"" style=""line-height: 20px;"">"
		if ShowTitle<>"" then
		TypeJs=TypeJs&"<a href="""&jsmovieurl&""" "&OpenS&" class="""&TitleStyle&""">"&zf(RS("MovieName"),TitleVolume,"")&"</a><br />" &vbcrlf
		end if
		if ShowActor<>"" then
		TypeJs=TypeJs&"主演:"&Actor(RS("MovieActor"),ActorVolume,OpenS)&"<br />" &vbcrlf
		end if
		if ShowRegion<>"" then
        TypeJs=TypeJs&"地区:"&RegionName(RS("MovieRegion"),OpenS)&"<br />" &vbcrlf
		end if
		if Showtype<>"" then
        TypeJs=TypeJs&"类型:"&ClassName(RS("TypeID"),jsclassurl,OpenS)&"<br />" &vbcrlf
		end if
		if ShowCoin<>"" then
        TypeJs=TypeJs&"影币:"&RS("MovieCoin")&"<br />" &vbcrlf
		end if
		if ShowClick<>"" then
        TypeJs=TypeJs&"观看次数:"&RS("MovieClick")&"次<br />" &vbcrlf

		end if
		if ShowDate<>"" then
        TypeJs=TypeJs&"添加时间:"&timedate(RS("MovieDate"))&"<br />" &vbcrlf
		end if
		if ShowContent<>"" then
        TypeJs=TypeJs&"剧情看点:"&zf(RS("MovieContent"),ContentVolume,"")&"</td>" &vbcrlf
		end if
  		TypeJs=TypeJs&"</tr>" &vbcrlf
		TypeJs=TypeJs&"</table></td>" &vbcrlf
		Case 2
		TypeJs=TypeJs&"<td width="""&(100/TdVolume)&"%""><table width=""100%"" border=""0"" cellspacing=""5"" cellpadding=""0"">" &vbcrlf
        TypeJs=TypeJs&"<tr>" &vbcrlf
        TypeJs=TypeJs&"<td valign=""top"" style=""line-height: 20px;"">"
		if ShowTitle<>"" then
		TypeJs=TypeJs&"<a href="""&jsmovieurl&""" "&OpenS&" class="""&TitleStyle&""">"&zf(RS("MovieName"),TitleVolume,"")&"</a><br />" &vbcrlf
		end if
		if ShowActor<>"" then
		TypeJs=TypeJs&"主演:"&Actor(RS("MovieActor"),ActorVolume,OpenS)&"<br />" &vbcrlf
		end if
		if ShowRegion<>"" then
        TypeJs=TypeJs&"地区:"&RegionName(RS("MovieRegion"),OpenS)&"<br />" &vbcrlf
		end if
		if Showtype<>"" then
        TypeJs=TypeJs&"类型:"&ClassName(RS("TypeID"),jsclassurl,OpenS)&"<br />" &vbcrlf
		end if
		if ShowCoin<>"" then
        TypeJs=TypeJs&"影币:"&RS("MovieCoin")&"<br />" &vbcrlf
		end if
		if ShowClick<>"" then
        TypeJs=TypeJs&"观看次数:"&RS("MovieClick")&"次<br />" &vbcrlf
		end if
		if ShowDate<>"" then
        TypeJs=TypeJs&"添加时间:"&timedate(RS("MovieDate"))&"<br />" &vbcrlf
		end if
		if ShowContent<>"" then
        TypeJs=TypeJs&"剧情看点:"&zf(RS("MovieContent"),ContentVolume,"")&"</td>" &vbcrlf
		end if
		TypeJs=TypeJs&"<td width="""&(picwidth+20)&"""><table border=""0"" align=""center"" cellpadding=""5"" cellspacing=""0"" bgcolor="""&BgColor&""" background="""&BgPic&""" style=""border: 1px solid "&BorderColor&";"">" &vbcrlf
        TypeJs=TypeJs&"<tr>" &vbcrlf
        TypeJs=TypeJs&"<td align=""center""><a href="""&jsmovieurl&""" "&OpenS&"><img src="""&RS("MoviePic")&""" width="""&picwidth&""" height="""&picheight&""" border=""0""></td></a>" &vbcrlf
        TypeJs=TypeJs&"</tr>" &vbcrlf
       	TypeJs=TypeJs&"</table></td>" &vbcrlf
		TypeJs=TypeJs&"</tr>" &vbcrlf
		TypeJs=TypeJs&"</table></td>" &vbcrlf
		Case 3
		TypeJs=TypeJs&"<td width="""&(100/TdVolume)&"%""><table width=""100%"" border=""0"" cellspacing=""5"" cellpadding=""0"">" &vbcrlf
        TypeJs=TypeJs&"<tr>" &vbcrlf
        TypeJs=TypeJs&"<td><table border=""0"" align=""center"" cellpadding=""5"" cellspacing=""0"" bgcolor="""&BgColor&""" background="""&BgPic&""" style=""border: 1px solid "&BorderColor&";"">" &vbcrlf
        TypeJs=TypeJs&"<tr>" &vbcrlf
        TypeJs=TypeJs&"<td align=""center""><a href="""&jsmovieurl&""" "&OpenS&"><img src="""&RS("MoviePic")&""" width="""&picwidth&""" height="""&picheight&""" border=""0""></a></td>" &vbcrlf
        TypeJs=TypeJs&"</tr>" &vbcrlf
       	TypeJs=TypeJs&"</table></td>" &vbcrlf
		TypeJs=TypeJs&"</tr><tr>" &vbcrlf
        TypeJs=TypeJs&"<td align=""center"" valign=""top"">"
		if ShowTitle<>"" then
		TypeJs=TypeJs&"<a href="""&jsmovieurl&""" "&OpenS&" class="""&TitleStyle&""">"&zf(RS("MovieName"),TitleVolume,"")&"</a><br />" &vbcrlf
		end if
		if ShowActor<>"" then
		TypeJs=TypeJs&"主演:"&Actor(RS("MovieActor"),ActorVolume,OpenS)&"<br />" &vbcrlf
		end if
		if ShowRegion<>"" then
        TypeJs=TypeJs&"地区:"&RegionName(RS("MovieRegion"),OpenS)&"<br />" &vbcrlf
		end if
		if Showtype<>"" then
        TypeJs=TypeJs&"类型:"&ClassName(RS("TypeID"),jsclassurl,OpenS)&"<br />" &vbcrlf
		end if
		if ShowCoin<>"" then
        TypeJs=TypeJs&"影币:"&RS("MovieCoin")&"<br />" &vbcrlf
		end if
		if ShowClick<>"" then
        TypeJs=TypeJs&"观看次数:"&RS("MovieClick")&"次<br />" &vbcrlf
		end if
		if ShowDate<>"" then
        TypeJs=TypeJs&"添加时间:"&timedate(RS("MovieDate"))&"<br />" &vbcrlf
		end if
		if ShowContent<>"" then
        TypeJs=TypeJs&"剧情看点:"&zf(RS("MovieContent"),ContentVolume,"")&"</td>" &vbcrlf
		end if
  		TypeJs=TypeJs&"</tr>" &vbcrlf
		TypeJs=TypeJs&"</table></td>" &vbcrlf
		Case 4
		TypeJs=TypeJs&"<td width="""&(100/TdVolume)&"%""><table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""0"">" &vbcrlf
        TypeJs=TypeJs&"<tr>" &vbcrlf
		if ShowRegion<>"" then
        TypeJs=TypeJs&"<td width=""70"" style=""line-height: 20px;"">["&RegionName(RS("MovieRegion"),OpenS)&"]</td>" &vbcrlf
		end if
		if Showtype<>"" then
        TypeJs=TypeJs&"<td width=""50"" style=""line-height: 20px;"">["&ClassName(RS("TypeID"),jsclassurl,OpenS)&"]</td>" &vbcrlf
		end if
		if ShowTitle<>"" then
		TypeJs=TypeJs&"<td><a href="""&jsmovieurl&""" "&OpenS&"  class="""&TitleStyle&""">"&zf(RS("MovieName"),TitleVolume,"")&"</a></td>" &vbcrlf
		end if
		if ShowDate<>"" then
        TypeJs=TypeJs&"<td width=""70"">"&timedate(RS("MovieDate"))&"</td>" &vbcrlf
		end if
  		TypeJs=TypeJs&"</tr>" &vbcrlf
		TypeJs=TypeJs&"</table></td>" &vbcrlf
		end Select
		if i mod TdVolume = 0 then TypeJs=TypeJs&"</tr><tr>" &vbcrlf
		RS.movenext     
		loop
		RS.close
		Set RS = Nothing
		TypeJs=TypeJs&"</tr>" &vbcrlf
		TypeJs=TypeJs&"</table>"
end function

function HtmltoJs(somecontent)
arrLines = Split(somecontent, Chr(10) )
  If IsArray(arrLines) then
   strNew = "<!-- //" & Chr(10)
   For i=0 To UBound( arrLines )
    sLine = Replace( arrLines(i) , "'" , "\'")
    sLine = Replace( sLine , Chr(13) , "" )
    strNew = strNew & "document.write('" & sLine  & "');" & Chr(10)
   Next
   strNew = strNew &"//-->"
   HtmltoJs=strNew
  end if
end function

function FsoList(CurrPath)
Response.Write"<script language=""javascript"">" &vbcrlf
Response.Write"function cpylink(btn,obj)" &vbcrlf
Response.Write"{" &vbcrlf
Response.Write"therange=obj.createTextRange();" &vbcrlf 
Response.Write"therange.execCommand(""copy"");" &vbcrlf 
Response.Write"btn.value = ""复制完毕"";" &vbcrlf 
Response.Write"}" &vbcrlf 
Response.Write"</script>"
Set FsoObj = Server.CreateObject("Scripting.FileSystemObject")
Set FolderObj = FsoObj.GetFolder(Server.MapPath(CurrPath))
Set FileObj = FolderObj.Files
Response.Write"<table class=table cellspacing=1 cellpadding=3 width=""98%"" align=center border=0>" &vbcrlf
Response.Write"<tbody>" &vbcrlf
Response.Write"<tr>" &vbcrlf
Response.Write"<td align=""center"" class=xingmu>JS文件名称</td>" &vbcrlf
Response.Write"<td width=""60%"" align=""center"" class=xingmu>JS调用代码</td>" &vbcrlf
Response.Write"<td width=""15%"" align=""center"" class=xingmu>添加时间</td>" &vbcrlf
Response.Write"<td width=""6%"" align=""center"" class=xingmu>操作</td>" &vbcrlf
Response.Write"</tr>" &vbcrlf
For Each FsoItem In FileObj
Response.Write"<tr>" &vbcrlf
Response.Write"<td align=""center"" height=32 class=""hback"">"&FsoItem.name&"</td>" &vbcrlf
Response.Write"<td align=""center"" class=""hback""><input id=""myurl"" name=""myurl"" size=""60"" value='&lt;script language=""JavaScript"" src="""&GetConfig("Weburl")&"/JS/"&FsoItem.name&"""&gt;&lt;/script&gt;'> <input type=""button"" value=""复制代码"" name=""B3"" onclick=""javascript:cpylink(this,document.getElementById('myurl'))""></td>" &vbcrlf
Response.Write"<td align=""center"" class=""hback"">"&FsoItem.DateLastModified&"</td>" &vbcrlf
Response.Write"<td align=""center"" class=""hback""><A href=""Admin_JsSub.asp?Action=Del&Name="&FsoItem.name&""">删除</A></td>" &vbcrlf
Response.Write"</tr>" &vbcrlf
Next
Set FsoObj = Nothing
Set FileObj = Nothing
Response.Write"</tbody>" &vbcrlf
Response.Write"</table>" &vbcrlf
end function%>